package cn.itsource.org.mapper;

import cn.itsource.org.domain.Department;
import cn.itsource.org.query.DepartmentQuery;

import java.util.List;

public interface DepartmentMapper {
    /**
     * 新增部门
     * @param department
     */
    void saveDepartment(Department department);

    /**
     * 修改部门
     * @param department
     */
    void updateDepartment(Department department);

    /**
     * 根据主键id删除数据
     * @param id
     */
    void deleteById(Long id);

    /**
     * 查询所有的部门
     * @return
     */
    List<Department> findAll();

    /**
     * 根据主键id查询单个部门
     * @param id
     * @return
     */
    Department findById(Long id);

    /**
     * 查询总条数，根据查询条件
     * @param query
     * @return
     */
    Long findCountByQuery(DepartmentQuery query);

    /**
     * 查询列表，根据查询条件
     * @param query
     * @return
     */
    List<Department> findAllByQuery(DepartmentQuery query);
}
